var gId = function(obj){
    return document.getElementById(obj);
}

var vals = {
    use : gId('username'),
    pwd : gId('password'),
    pwd2: gId('password2'),
    btn : gId('submit')
}
function addEvent(obj,event,func){
    obj.addEventListener(event,func)
}
function testUser(){
    if (vals.use.value === ''){
        vals.use.style.backgroundColor = '#FF8569';
    } else {
        vals.use.style.backgroundColor = '';
    }
}
addEvent(vals.use,'blur',testUser);
addEvent(vals.pwd,'blur',testPwd);
addEvent(vals.pwd2,'blur',testPwd2);


